﻿# CMakeList.txt: 顶层 CMake 项目文件，在此处执行全局配置
# 并包含子项目。
#
cmake_minimum_required (VERSION 3.8)

project ("PluginLoader")

file(GLOB PluginLoader_CC *.cc)
file(GLOB PluginLoader_HH *.h)
add_executable(PluginLoader ${PluginLoader_HH} ${PluginLoader_CC})

if(NOT CMAKE_HOST_WIN32)
	target_link_libraries(PluginLoader dl)
	target_link_libraries(PluginLoader pthread)
endif()

if(NOT FG_DYNAMIC_PLUGIN)
add_dependencies(PluginLoader "Core")
add_dependencies(PluginLoader "Protocol")
add_dependencies(PluginLoader "ConfigPlugin")
add_dependencies(PluginLoader "LogPlugin")
add_dependencies(PluginLoader "SecurityPlugin")
add_dependencies(PluginLoader "NetPlugin")
add_dependencies(PluginLoader "MasterNetServerPlugin")
add_dependencies(PluginLoader "WorldNetClientPlugin")
add_dependencies(PluginLoader "WorldNetServerPlugin")
add_dependencies(PluginLoader "ProxyServerNetClientPlugin")
add_dependencies(PluginLoader "ProxyServerNetServerPlugin")
add_dependencies(PluginLoader "ProxyLogicPlugin")

target_link_libraries(PluginLoader Protocol)
target_link_libraries(PluginLoader ConfigPlugin)
target_link_libraries(PluginLoader LogPlugin)
target_link_libraries(PluginLoader SecurityPlugin)
target_link_libraries(PluginLoader NetPlugin)
target_link_libraries(PluginLoader MasterNetServerPlugin)
target_link_libraries(PluginLoader WorldNetClientPlugin)
target_link_libraries(PluginLoader WorldNetServerPlugin)
target_link_libraries(PluginLoader ProxyServerNetClientPlugin)
target_link_libraries(PluginLoader ProxyServerNetServerPlugin)
target_link_libraries(PluginLoader ProxyLogicPlugin)
endif()

set_target_properties(PluginLoader PROPERTIES OUTPUT_NAME_DEBUG "GameNetFrame")
set_target_properties(PluginLoader PROPERTIES OUTPUT_NAME "GameNetFrame")
set_target_properties(PluginLoader PROPERTIES PREFIX "")
set_target_properties(PluginLoader PROPERTIES 
	ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
	RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
	LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})